<%@ page import="com.cn.entity.NewsInfo" %>
<%@ page import="com.cn.Dao.NewsinfoDao" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%--
  Created by IntelliJ IDEA.
  User: cza20
  Date: 2021/4/4
  Time: 22:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>全部报刊</title>
    <link rel="shortcut icon" href="<%=request.getContextPath()%>/img/logo2.png" type="image/x-icon">
</head>
<body>
<%
    Object message = request.getAttribute("message");
    if (message != null && message!=""){
%>
<script type="text/javascript">
    alert("<%=message%>")
</script>
<%}%>
<%request.setAttribute("message","");%>
<!--jsp:include page="index.html"/-->
<jsp:include page="index.html"/>
<jsp:include page="WEB-INF/header/header-user.jsp"/>
<%--
    List<NewsInfo> list=new ArrayList<>();
    list = (List) request.getAttribute("newsInfoList");
    if(list.size()==0){
        out.println("hehe");
    }
--%>
<div class="row" style="width: 1300px; margin: 0 auto;">
    <c:forEach items="${newsInfoList}" var="newsInfo">
        <div class="col-md-2">
            <img src="ShowPicServlet?name=${newsInfo. getNum()}" height="300" >
            <p>
                <a href="newspaper_detail.jsp?num=${newsInfo. getNum()}" style="color: green">${newsInfo.getName()}</a>
            </p>
            <p>
                <font color="#ff0000">每月订阅价：&yen;${newsInfo.getPrice()}</font>
            </p>
        </div>
    </c:forEach>
</div>
</body>
</html>
